package com.contrarywind.listener;

import com.contrarywind.view.WheelView;
import ohos.agp.components.Component;
import ohos.agp.components.DragInfo;


/**
 * 手势监听
 */
public final class LoopViewGestureListener implements Component.DraggedListener {

    private final WheelView wheelView;


    public LoopViewGestureListener(WheelView wheelView) {
        this.wheelView = wheelView;
    }

   /* @Override
    public final boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
        wheelView.scrollBy(velocityY);
        return true;
    }*/

    @Override
    public void onDragDown(Component component, DragInfo dragInfo) {
        wheelView.scrollBy((float) dragInfo.yVelocity);
    }

    @Override
    public void onDragStart(Component component, DragInfo dragInfo) {

    }

    @Override
    public void onDragUpdate(Component component, DragInfo dragInfo) {

    }

    @Override
    public void onDragEnd(Component component, DragInfo dragInfo) {

    }

    @Override
    public void onDragCancel(Component component, DragInfo dragInfo) {

    }
}
